package com.hehao.kurunner.ui.fragment;

import android.content.Intent;
import android.view.View;
import android.widget.Toast;

import com.hehao.kurunner.R;
import com.hehao.kurunner.common.BaseFragment;
import com.hehao.kurunner.ui.mine.InfoActivity;
import com.hehao.kurunner.ui.mine.SettingActivity;

/**
 * @author HeHao
 * @time 2015/11/13 15:42
 * @email 139940512@qq.com
 */
public class MineFragment extends BaseFragment {
    @Override
    protected void initView() {
        setLayoutWithCommonHeader(R.layout.fragment_mine);
        setHeadTitle(R.string.title_mine);

        getViewWithClick(R.id.rl_setting);
        getViewWithClick(R.id.rl_info);
        getViewWithClick(R.id.rl_attention);
        getViewWithClick(R.id.rl_data);
    }

    @Override
    protected void initData() {
    }

    @Override
    protected void onViewClick(View v) {
        if(v.getId() == R.id.rl_setting){
//            Toast.makeText(getActivity(), "点击了设置", Toast.LENGTH_SHORT).show();

//            跳转到SettingActivity
            startActivity(new Intent(getActivity(), SettingActivity.class));
        }
        if(v.getId()==R.id.rl_info){
//            Toast.makeText(getActivity(),"点击了个人资料",Toast.LENGTH_SHORT).show();
            startActivity(new Intent(getActivity(), InfoActivity.class));
        }
        if(v.getId()==R.id.rl_attention){
            Toast.makeText(getActivity(),"点击了我关注的",Toast.LENGTH_SHORT).show();
        }
        if(v.getId()==R.id.rl_data){
            Toast.makeText(getActivity(),"我的运动数据",Toast.LENGTH_SHORT).show();
        }
    }
}
